#ifndef MESH_H
#define MESH_H


#include"Vertex.h"
#include"Transform.h"
#include<vector>

using std::vector;


class Mesh {
public:
	Transform transform;
	vector<Vertex> vertexBuffer;
	vector<Vec4f> positionBuffer;
	vector<Vec4f> normalBuffer;
	vector<Vec2> uvBuffer;
	vector<Vec4i> indexBuffer;


	Mesh();
	~Mesh();

	Transform GetTransform() { return transform; }
	int GetIndexBufferSize() { return indexBuffer.size(); }
	void SetTransform(Transform& trans) { transform = trans; }
	Matrix GetObjectToWorld() { return transform.objectToWorld; }
	void SetObjectToWorld(const Matrix& mat) { transform.objectToWorld = mat; }


	void AddVertex(const Vec4f pos, float u, float v, const Color color = Color::white);
	void AddVertex(float x,float y,float z, float u, float v, const Color color = Color::white);
	void AddVertex(float x, float y, float z, float u, float v,Vec4f norm, const Color color = Color::white);
};




#endif // !MESH_H

